using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using Bussiness.Config;     
using Bussiness.Entity;
namespace Bussiness.ManagerBase
{
                

     public abstract class CmsCompanyManagerBase
    {
        public CmsCompanyManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>CmsCompanyEntity</returns>
        public CmsCompanyEntity Insert(CmsCompanyEntity obj)
        { 
            return (CmsCompanyEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>CmsCompanyEntity</returns>
        public CmsCompanyEntity Update(CmsCompanyEntity obj)
        { 
            return (CmsCompanyEntity)Adapter.Update(obj);             
        }
 
 
        public CmsCompanyEntity Delete(CmsCompanyEntity obj)
        { 
            return (CmsCompanyEntity)Adapter.Delete(obj);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien ContentBody duoc set trong object
        /// </summary>
        /// <returns>CmsCompanyEntity</returns>
        public CmsCompanyEntity DeleteByContentBody (CmsCompanyEntity obj)
        { 
            return (CmsCompanyEntity)Adapter.DeleteByField(obj,"ContentBody");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien ContentBody 
        /// </summary>
        /// <returns>CmsCompanyEntity</returns>
        public CmsCompanyEntity DeleteByContentBody (string ContentBody )
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.ContentBody = ContentBody;  
            return (CmsCompanyEntity)Adapter.DeleteByField(obj,"ContentBody");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>CmsCompanyEntity</returns>
        public CmsCompanyEntity DeleteById (CmsCompanyEntity obj)
        { 
            return (CmsCompanyEntity)Adapter.DeleteByField(obj,"Id");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Id 
        /// </summary>
        /// <returns>CmsCompanyEntity</returns>
        public CmsCompanyEntity DeleteById (Guid Id )
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.Id = Id;  
            return (CmsCompanyEntity)Adapter.DeleteByField(obj,"Id");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Lang duoc set trong object
        /// </summary>
        /// <returns>CmsCompanyEntity</returns>
        public CmsCompanyEntity DeleteByLang (CmsCompanyEntity obj)
        { 
            return (CmsCompanyEntity)Adapter.DeleteByField(obj,"Lang");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Lang 
        /// </summary>
        /// <returns>CmsCompanyEntity</returns>
        public CmsCompanyEntity DeleteByLang (string Lang )
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.Lang = Lang;  
            return (CmsCompanyEntity)Adapter.DeleteByField(obj,"Lang");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public CmsCompanyEntity Select(CmsCompanyEntity obj)
        { 
            return (CmsCompanyEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(CmsCompanyEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(CmsCompanyEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new CmsCompanyEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new CmsCompanyEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<CmsCompanyEntity> SelectAllLST()
        { 
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new CmsCompanyEntity()),new CmsCompanyEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<CmsCompanyEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new CmsCompanyEntity(),option),new CmsCompanyEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien ContentBody duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByContentBody (CmsCompanyEntity obj)
        { 
            return Adapter.SelectByField(obj,"ContentBody");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ContentBody duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByContentBody (CmsCompanyEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"ContentBody",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ContentBody duoc set trong object
        /// </summary>
        /// <returns>List<CmsCompanyEntity></returns>
        public List<CmsCompanyEntity> SelectByContentBodyLST (CmsCompanyEntity obj)
        { 
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"ContentBody"),new CmsCompanyEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ContentBody duoc set trong object
        /// </summary>
        /// <returns>List<CmsCompanyEntity></returns>
        public List<CmsCompanyEntity> SelectByContentBodyLST (CmsCompanyEntity obj,SelectOptions option)
        { 
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"ContentBody",option),new CmsCompanyEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ContentBody 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByContentBody (string ContentBody )
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.ContentBody = ContentBody;  
            return Adapter.SelectByField(obj,"ContentBody");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ContentBody duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByContentBody (string ContentBody, SelectOptions option)
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.ContentBody = ContentBody;  
            return Adapter.SelectByField(obj,"ContentBody",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ContentBody 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCompanyEntity> SelectByContentBodyLST (string ContentBody )
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.ContentBody = ContentBody;  
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"ContentBody"),new CmsCompanyEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ContentBody duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCompanyEntity> SelectByContentBodyLST (string ContentBody, SelectOptions option)
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.ContentBody = ContentBody;  
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"ContentBody",option),new CmsCompanyEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (CmsCompanyEntity obj)
        { 
            return Adapter.SelectByField(obj,"Id");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (CmsCompanyEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"Id",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>List<CmsCompanyEntity></returns>
        public List<CmsCompanyEntity> SelectByIdLST (CmsCompanyEntity obj)
        { 
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id"),new CmsCompanyEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>List<CmsCompanyEntity></returns>
        public List<CmsCompanyEntity> SelectByIdLST (CmsCompanyEntity obj,SelectOptions option)
        { 
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"Id",option),new CmsCompanyEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (Guid Id )
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.Id = Id;  
            return Adapter.SelectByField(obj,"Id");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (Guid Id, SelectOptions option)
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.Id = Id;  
            return Adapter.SelectByField(obj,"Id",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCompanyEntity> SelectByIdLST (Guid Id )
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.Id = Id;  
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id"),new CmsCompanyEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCompanyEntity> SelectByIdLST (Guid Id, SelectOptions option)
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.Id = Id;  
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id",option),new CmsCompanyEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Lang duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByLang (CmsCompanyEntity obj)
        { 
            return Adapter.SelectByField(obj,"Lang");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Lang duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByLang (CmsCompanyEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"Lang",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Lang duoc set trong object
        /// </summary>
        /// <returns>List<CmsCompanyEntity></returns>
        public List<CmsCompanyEntity> SelectByLangLST (CmsCompanyEntity obj)
        { 
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Lang"),new CmsCompanyEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Lang duoc set trong object
        /// </summary>
        /// <returns>List<CmsCompanyEntity></returns>
        public List<CmsCompanyEntity> SelectByLangLST (CmsCompanyEntity obj,SelectOptions option)
        { 
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"Lang",option),new CmsCompanyEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Lang 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByLang (string Lang )
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.Lang = Lang;  
            return Adapter.SelectByField(obj,"Lang");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Lang duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByLang (string Lang, SelectOptions option)
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.Lang = Lang;  
            return Adapter.SelectByField(obj,"Lang",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Lang 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCompanyEntity> SelectByLangLST (string Lang )
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.Lang = Lang;  
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Lang"),new CmsCompanyEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Lang duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCompanyEntity> SelectByLangLST (string Lang, SelectOptions option)
        { 
            CmsCompanyEntity obj = new CmsCompanyEntity();
            obj.Lang = Lang;  
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Lang",option),new CmsCompanyEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<CmsCompanyEntity></returns>
        public List<CmsCompanyEntity> SelectWithConditionLST (CmsCompanyEntity obj)
        { 
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new CmsCompanyEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<CmsCompanyEntity></returns>
        public List<CmsCompanyEntity> SelectWithConditionLST (CmsCompanyEntity obj,SelectOptions option)
        { 
            return  (List<CmsCompanyEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new CmsCompanyEntity());
        }

}
}
